// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import "babel-polyfill";
import Clipboard from "clipboard";
import router from "./router";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "font-awesome/css/font-awesome.min.css";
import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";
import VueCookies from "vue-cookies";
import locationUrl from "./utils/locationUrl";

Vue.use(ElementUI);
Vue.use(VueCookies);
Vue.use(Viewer, {
  defaultOptions: {
    zIndex: 99999
  }
});

router.afterEach((to, from, next) => {
  setTimeout(() => {
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?2b296deeeccd704aea965e564f60be25";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  });
});

Vue.prototype.locationUrl = locationUrl();
Vue.prototype.imgDefault = require("@/assets/images/noupload.png");//默认图片

// router.beforeEach((to,from,next)=>{
//   if(VueCookies.get('signature')){
//     // next()
//     next({path:'/Home'});
//   }else{
//     next({path:'/login'});
//   }
// })

Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  components: { App },
  template: "<App/>"
});
